import unittest


# 需求：运行Demo1的test2方法和Demo2的testb方法

class Demo1TestCase(unittest.TestCase):
    def test1(self):
        print("test1")

    def test2(self):
        print("test2")


class Demo2TestCase(unittest.TestCase):
    def testa(self):
        print("testa")

    def testb(self):
        print("testb")


if __name__ == '__main__':
    # main方法
    # unittest.main(verbosity=2)
    # suite套件方法
    suite = unittest.TestSuite()
    suite.addTest(Demo1TestCase('test2'))
    suite.addTest(Demo2TestCase('testb'))

    # runner  suite执行器
    runner = unittest.TextTestRunner(verbosity=2)
    runner.run(suite)
